1. Field of the Invention
The present invention relates to an image inspection apparatus, an image inspection method, an image inspection program, a computer-readable recording medium and a recording device, each enabling inspection of a flaw and a printed character of a moving workpiece by a photometric stereo method.
2. Description of Related Art
There has been used an image inspection apparatus for performing inspection of the presence or absence of a flaw on the surface of a workpiece, an external shape thereof, and reading of a printed character thereon. Such an image inspection apparatus performs necessary illumination on a workpiece (inspection target or subject), captures its image, and performs image processing such as edge detection on the obtained image data, to perform determination such as defective/non-defective determination based on a result of the processing.
However, in such an image inspection apparatus, there has been a case where the viewing easiness varies by a type of illumination or a direction of applying illumination, depending on a type of the workpiece. For this reason, performing appropriate inspection on such a workpiece has required sufficient information and experiences.
Further, in the conventional image inspection apparatus, erroneous inspection is apt to occur due to a small change in illumination condition, installation condition or the like, and stably performing inspection is difficult, which has been problematic. Further, in visual inspection of the workpiece, although both information on a shape of the workpiece such as a flaw and an edge, i.e., three-dimensional information, and planar information such as a printed character and a stain are inspection targets, those information cannot be detected well in some cases as a result of interference of the information, which has also been problematic.
As a technique for solving such problems, there is known an image processing apparatus for acquiring height information by a photometric stereo method (e.g., see Unexamined Japanese Patent Publication No. 2007-206797). Here, the photometric stereo method is one of techniques for three-dimensional measurement where an image is captured by illumination from a plurality of different illumination directions to find a normal vector of a workpiece from shadow information on the image. An image processing apparatus using such a photometric stereo method creates, from a normal vector (corresponding to an inclination image), an image with components on an X-axis and a Y-axis replaced by a luminance value or a reflectance image (corresponding to an albedo image), and applies the image to image inspection. Here, in order to accurately perform three-dimensional measurement by the photometric stereo method, consideration has been made mainly on a method for installation of an illumination device and a method for irradiation with illumination light.    [Non-patent Document 1] F. Pernkopf, P. O'Leary, “Image acquisition techniques for automatic visual inspection of metallic surfaces”, NDT & E International, Elsevier (2003).
The photometric stereo method is normally implemented on the assumption that the position of a plurality of captured images is the same as that of the workpiece. In other words, it is necessary that the workpiece is still and a partial illumination image illuminated from any illumination direction is obtained by capturing the same portion of the same workpiece.
Also in Unexamined Japanese Patent Publication No. 2007-206797 described above, a workpiece not moving but being still is used as a target.
In contrast, in image inspection being used in the field of FA and the like, there are many uses in which image inspection is to be executed on a moving workpiece. For example, when image inspection is to be performed on a workpiece moving on a belt conveyor by the photometric stereo method, the assumption that the position of a plurality of captured images is the same as that of an imaging target is not fulfilled, and hence the method cannot be used as it is.